
package com.idealighter.game.log.struct.roomcard.mustniuniu;

import com.idealighter.game.core.common.Game;
import com.idealighter.game.dblog.annotation.Column;
import com.idealighter.game.dblog.annotation.LogTable;
import com.idealighter.game.dblog.core.TableType;
import com.idealighter.game.log.core.PlayerLog;
import com.idealighter.game.player.struct.Player;
import com.idealighter.game.roomcard.games.mustniuniu.struct.MustNiuNiuSeat;

/**
 * 房卡费用日志 .
 */
@LogTable(type = TableType.DAY)
public class RoomCardMustNiuNiuWinLoseLog extends PlayerLog {
  @Column(type = "int", size = 11, remark = "游戏")
  public final int game;
  @Column(type = "varchar", size = 64, remark = "游戏名称")
  public final String gameName;
  @Column(type = "bigint", size = 20, remark = "房间")
  public final long room;
  @Column(type = "bigint", size = 20, remark = "下自己的筹码")
  public final long betSelf;
  @Column(type = "bigint", size = 20, remark = "下自己赢得筹码")
  public final long winSelf;
  @Column(type = "bigint", size = 20, remark = "买码玩家编号")
  public final long betOtherPlayerId;
  @Column(type = "bigint", size = 20, remark = "买码玩家筹码")
  public final long betOtherBetChips;
  @Column(type = "bigint", size = 20, remark = "买码玩家赢得筹码")
  public final long betOtherWinChips;
  @Column(type = "bigint", size = 20, remark = "总输赢")
  public final long totalWin;

  /**
   * 构造函数.
   * 
   * @param player 玩家.
   * @param game .
   */
  public RoomCardMustNiuNiuWinLoseLog(Player player, Game game) {
    super(player);
    this.game = game.getType();
    this.gameName = game.getDesc();
    this.room = player.curRoom.getId();
    MustNiuNiuSeat seat = (MustNiuNiuSeat) player.curSeat;
    this.betSelf = seat.getBetedchips();
    this.winSelf = seat.getBillChips() - seat.getBetOtherWinChips();
    this.betOtherPlayerId = seat.getBetOtherPlayerId() == null ? 0L : seat.getBetOtherPlayerId();
    this.betOtherBetChips = seat.getBetOtherBetChips();
    this.betOtherWinChips = seat.getBetOtherWinChips();
    this.totalWin = seat.getBillChips();
  }
}
